<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="scss/02.min.css">
</head>
<body>
    <div id="app">
        <div>
            <span @click="flag ^= 1">图片显示</span>
            <span @click="age++">年龄增加</span>
            <span @click="age--">年龄减小</span>
        </div>
        <div>年龄大于等于18时，第二章图显示，目前年龄{{age}}</div>
        <img v-if="flag == 1" src="img/2.jpg">
        <img v-if="flag == 1 && age >= 18" src="img/1.jpg">
    </div>
    <script src="https://unpkg.com/vue@next"></script>
	<script>
        const vm = Vue.createApp({
            data(){
                return{
                    flag: 1,
                    text: 44,
                    age: 16,
                }
            }
        }).mount('#app');
    </script>	
</body>
</html>